import request from './../utils/request'

export default {
  // 供应商列表
  getSupplierList (currentPage, pageSize, query) {
    return request({
      url: `/supplier/list/search/${currentPage}/${pageSize}`,
      method: 'post',
      data: {
        query
      }
    })
  },
  // 新增供应商成功
  addSupplier (addForm) {
    return request({
      url: '/supplier',
      method: 'post',
      data: addForm
    })
  },
  // 根据id得到数据
  getById (id) {
    return request({
      url: `/supplier/${id}`,
      method: 'get'
    })
  },
  updated (formName) {
    return request({
      url: `/supplier/${formName.id}`,
      method: 'put',
      data: formName
    })
  },
  // 删除供应商
  deleteById (id) {
    return request({
      url: `/supplier/${id}`,
      method: 'delete'
    })
  }
}
